<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script src="https://cdn.bootcdn.net/ajax/libs/axios/1.3.6/axios.js"></script>
  <!-- <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script> -->


  <button id="btn">按钮</button>
  <div class="box"></div>
  <script>
    const btn = document.querySelector('#btn')
    const box = document.querySelector('.box')
    btn.addEventListener('click', () => {
      axios({
        url: 'http://hmajax.itheima.net/api/province'
      }).then((result) => {
        console.log(result.data.list, 111);
        /* 将获取的数据渲染到页面上 */
        box.innerHTML = result.data.list.join(' ')
      })
    })

  </script>
</body>

</html>